<?php

namespace App\Models\Admin;

use Zizaco\Entrust\EntrustRole;

class Role extends EntrustRole
{
    //name — Unique name for the Role, used for looking up role information in the application layer. For example: "admin", "owner", "employee".
    //display_name — Human readable name for the Role. Not necessarily unique and optional. For example: "User Administrator", "Project Owner", "Widget Co. Employee".
    //description — A more detailed explanation of what the Role does. Also optional.

    public function permissions()
    {
        return $this->belongsToMany('App\Models\Admin\Permission', 'permission_role', 'role_id', 'permission_id');
    }

    public function users()
    {
        return $this->belongsToMany('App\Models\Admin\User', 'role_user', 'role_id', 'user_id');
    }

}
